﻿using DAL.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DAL.Persistencia
{
    public class GroupAmenitiesDAL
    {
        private NewTierraEntities Con;

        public GroupAmenitiesDAL()
        {
            Con = new NewTierraEntities();
        }

        public List<S_GroupAmenities> ListarTodos()
        {
            try
            {
                return Con.S_GroupAmenities.OrderBy(a => a.S_GroupAmenities_Name).ToList();
            }
            catch (Exception)
            {

                throw;
            }
        }

        public S_GroupAmenities ObterPorID(int IdGrupo)
        {
            try
            {
                return Con.S_GroupAmenities.Where(s => s.S_GroupAmenities_ID == IdGrupo).SingleOrDefault();
            }
            catch 
            {                
                throw;
            }
        }
    }
}
